Problem: $f(x, y, z) = \left( x, 2y, -z^2 \right)$ What is the divergence of $f$ at $(0, 2, 3)$ ?
The formula for divergence in three dimensions is $\text{div}(f) = \dfrac{\partial P}{\partial x} + \dfrac{\partial Q}{\partial y} + \dfrac{\partial R}{\partial z}$, where $P$ is the $x$ -component of $f$, $Q$ is the $y$ -component, and $R$ is the $z$ -component. Let's differentiate! $\begin{aligned} \dfrac{\partial P}{\partial x} &= \dfrac{\partial}{\partial x} \left[ x \right] \\ \\ &= 1 \\ \\ \dfrac{\partial Q}{\partial y} &= \dfrac{\partial}{\partial y} \left[ 2y \right] \\ \\ &= 2 \\ \\ \dfrac{\partial R}{\partial z} &= \dfrac{\partial}{\partial z} \left[ -z^2 \right] \\ \\ &= -2z \end{aligned}$ Adding the three partial derivatives, $\text{div}(f) = 3 - 2z$. The divergence of $f$ at $(0, 2, 3)$ is $-3$.